﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Framework.Infrastructure.IoC;
using CodeFirstDomain.IService;
using Framework.Infrastructure;

namespace AppWcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "AppWcfService2" in code, svc and config file together.
    [IocServiceBehavior]
    public class AppWcfService2 : IAppWcfService2
    {
        IQueryService _queryService;
        public AppWcfService2(IQueryService queryService)
        {
            _queryService = queryService;
        }

        public void DoWork()
        {
            var user = _queryService.GetUsers().FirstOrDefault();

            user = IoCFactory.Resolve<IQueryService>().GetUsers().FirstOrDefault();
        }

        #region IDisposable Members

        public void Dispose()
        {
            Utility.DisposeContainerExtensions();
        }

        #endregion
    }
}
